- content_for :meta do
  %meta{:name => "Description", :content => (@photo.caption ? @photo.caption : @photo.filename)}
  %meta{:name => "Abstract", :content => "Jetty Rae's Photos"}
  %meta{:name => "Keywords", :content => "photos, jetty rae"}
- content_for :title do
  = "- " + (@photo.caption ? @photo.caption : @photo.filename)
- content_for :page_description do
  %p Here's a photo from one of Jetty Rae's shows.
%table.photo{:align => "center"}
  %tr
    %td.photo
      %img.screen_photo{:src => @photo.public_filename(:screen), :title => (@photo.caption ? @photo.caption : @photo.filename)}
      - if @photo.show
        %div.show
          Taken at
          %a{:href => show_url(@photo.show), :alt => @photo.show.location, :title => @photo.show.location + " on " + @photo.show.start_time.strftime("%B %o, %Y")}=@photo.show.location
  %tr
    %td.caption
      = @photo.caption
  - if logged_in? && current_user.is_admin?
    %tr
      %td
        %table
          %tr
            %td.field_title Edit:
            %td.field
              %a{:href => edit_photo_url(@photo), :title => "Edit \"#{(@photo.caption ? @photo.caption : @photo.filename)}\"", :alt => "Edit \"#{(@photo.caption ? @photo.caption : @photo.filename)}\""}="Edit \"#{(@photo.caption ? @photo.caption : @photo.filename)}\""
%hr
- unless @photo.comments.empty?
  %div.heading
    %img.heading{:src => "/images/headings/comments.jpg", :title => "Comments", :alt => "Comments"}
  %ol.comment_list
    - @photo.comments.each do |comment|
      %li.comment
        - if logged_in? && current_user.is_admin?
          %div.delete_comment
            - form_for comment, comments_url, :html => {:method => :delete} do |form|
              = submit_tag "delete"
        %a.comment_user{:href => user_url(comment.user), :title => "Comment by " + comment.user.login}= comment.user.login
        says:
        %p.comment_date= comment.created_at.strftime("%B %o at %I:%M %p")
        %p.comment_text= sanitize(comment.text)
- if logged_in?
  %table.new_comment
    - form_for @comment do |form|
      %tr
        %td= error_messages_for :comment
      %tr
        %td
          %input{:value => @photo.id, :name => "comment[photo_id]", :type => "hidden"}
          = form.text_area :text, :class => "comment_entry"
      %tr  
        %td.submit= submit_tag 'add comment'
- else
  %p.new_comment
    = "Have something to say about \"" + (@photo.caption ? @photo.caption : @photo.filename) + "?\""
    %a{:href => login_url, :title => "Login to jetty rae's website"}Login
    or
    %a{:href => signup_url, :title => "Sign up on jetty rae's website"}Signup